package com.changli08.constructor;

public class Triangle {
    private double base;
    private double height;
    public Triangle(double base, double height) {
        this.base = base;
        this.height = height;
    }
    //访问底
    public double getBase() {
        return base;
    }
    public void setBase(double base) {
        this.base = base;
    }
    //访问高
    public double getHeight() {
        return height;
    }
    public void setHeight(double height) {
        this.height = height;
    }
    //计算面积
    public double getArea(){
        return base*height*0.5;
    }
}
